package d2_reflect;

/**
 * 目标: 获取Class对象
 */
public class Test1Class {
    public static void main(String[] args) throws Exception {
        //1、类名.class
        Class c1 = Student.class;
        System.out.println(c1);

        //2、调用Class提供的方法: public static Class forName(String package)
        Class c2 = Class.forName("d2_reflect.Student");
        System.out.println(c2);


        System.out.println(c1 == c2);
        //3、得到这个类的对象, 在通过对象获取其Class对象
        /*Student s1 = new Student();
        Class c3 = s1.getClass();
        System.out.println(c3);*/

        System.out.println(c1 == c2);
    }
}
